<!DOCTYPE html>
<html lang="en">
<head>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <button @click="showInfo">请单击</button>
        <p>{{msg}}</p>
    </div>
    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                msg:"！"
            },
            methods:{
                showInfo:function(){
                    this.$data.msg = '按钮已被单击！'
                    // vm.$data.msg = 'methods里this相当于vm！'
                    // this.msg = '按钮已被单击！'
                }
            }
        });
    </script>
</body>
</html>